﻿Public NotInheritable Class barcodeType

    Public Property codigo As String
    Public Property descricao As String
    Private Shared listbt As List(Of barcodeType)

    Shared Sub New()
        Call ListType()
    End Sub


    Private Shared Sub ListType()

        listbt = New List(Of barcodeType)

        listbt.Add(New barcodeType With {.codigo = "A", .descricao = "3 OF 9"})
        listbt.Add(New barcodeType With {.codigo = "B", .descricao = "UPC-A"})
        listbt.Add(New barcodeType With {.codigo = "C", .descricao = "UPC-E"})
        listbt.Add(New barcodeType With {.codigo = "D", .descricao = "INTERLEAVED 2 OF 5"})
        listbt.Add(New barcodeType With {.codigo = "E", .descricao = "CODE 129"})
        listbt.Add(New barcodeType With {.codigo = "F", .descricao = "EAN-13"})
        listbt.Add(New barcodeType With {.codigo = "G", .descricao = "EAN-8"})
        listbt.Add(New barcodeType With {.codigo = "H", .descricao = "HBIC"})
        listbt.Add(New barcodeType With {.codigo = "I", .descricao = "BAR CODE I"})
        listbt.Add(New barcodeType With {.codigo = "J", .descricao = "I25 WITH CHECKSUM"})
        listbt.Add(New barcodeType With {.codigo = "K", .descricao = "PLESSEY"})
        listbt.Add(New barcodeType With {.codigo = "L", .descricao = "I25 WITH CHECKSUM & BEARER"})
        listbt.Add(New barcodeType With {.codigo = "M", .descricao = "UPC2"})
        listbt.Add(New barcodeType With {.codigo = "N", .descricao = "UPC5"})
        listbt.Add(New barcodeType With {.codigo = "O", .descricao = "CODE 93"})
        listbt.Add(New barcodeType With {.codigo = "P", .descricao = "POSTNET"})
        listbt.Add(New barcodeType With {.codigo = "Q", .descricao = "UCC/EAN128"})
        listbt.Add(New barcodeType With {.codigo = "R", .descricao = "UCC/EAN128 K"})
        listbt.Add(New barcodeType With {.codigo = "T", .descricao = "TELEPEN"})
        listbt.Add(New barcodeType With {.codigo = "U", .descricao = "MAXI CODE"})
        listbt.Add(New barcodeType With {.codigo = "V", .descricao = "FIM"})
        listbt.Add(New barcodeType With {.codigo = "Z", .descricao = "PDF-417"})

    End Sub

    Public Shared Function getBarCodeType(ByVal pCodigo As String) As barcodeType

        Dim bc As barcodeType

        bc = (From b In listbt
              Where b.codigo = pCodigo
              Select b).First

        Return bc

    End Function

    Public Shared Function getList() As List(Of barcodeType)
        Return listbt
    End Function

End Class
